﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Pantry.Business;
using Pantry.Commons;
using Pantry.Entity;

namespace Pantry.Web.Users
{
    public partial class RegionDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var strTrustRegionId = Request.QueryString["TrustRegionId"];
            if (!Validates.IsNaturalNumber(strTrustRegionId))
            {
                ClientScript.RegisterStartupScript(GetType(), "key", "setDisplayNone();", true);
                return;
            }

            var trustRegionId = Convert.ToInt32(strTrustRegionId,CultureInfo.CurrentCulture);
            var trustRegionBus = new TrustRegionBus();
            if (trustRegionBus.RetrieveTrustRegion(trustRegionId)==null)
            {
                ClientScript.RegisterStartupScript(GetType(), "key", "setDisplayNone();", true);
            }
        }
    }
}
